{% extends 'LettralLetterBundle::layout.html.twig' %}   

{% block js %}<script type="text/javascript" src="{{ asset('bundles/lettraluser/js/jquery.address.js') }}"></script>{% endblock %}

{% block title %}Mes adresses{% endblock %}

{% block content %}

<h1 style="float: left">Mes adresses</h1>

<div class="btn_add"><a href="{{ path('user_contact_add') }}" class="action">Ajouter une adresse</a></div>

<div class="list">
    <table>
        <tr>
            <th class="top">Adresse</th>
            <th class="actions">Actions</th>
        </tr>
        {% for info in infos %}
        <tr>
            <td id="{{ info.numAdresse }}">
                {% if info.defaut %} 
                    <b>{{ info.adresse }} {{ info.cp }} {{ info.ville }} (par défaut)</b> 
                {% else %}
                    {{ info.adresse }} {{ info.cp }} {{ info.ville }}
                {% endif %}
            </td>
            <td class="actions">
                <a class="default" href="{{ path('user_contact_default', { 'id': info.numAdresse }) }}"><img src="{{ asset('bundles/lettralletter/images/ok.png') }}" ></a>
                &nbsp;&nbsp;<a class="action" href="{{ path('user_contact_edit', { 'id': info.numAdresse }) }}"><img src="{{ asset('bundles/lettralletter/images/edit.png') }}" ></a>
                &nbsp;&nbsp;<a class="delete" href="{{ path('user_contact_delete', { 'id': info.numAdresse }) }}"><img src="{{ asset('bundles/lettralletter/images/delete.png') }}" ></a>
            </td>
        </tr>
        {% else %}
        <tr>
            <td colspan="2">Vous n'avez aucune adresse d'enregistrée.</td>
        </tr>
        {% endfor %}
    </table>
</div>
{% endblock %}